home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 4
/
Precision Software Applications Silver Collection Volume 4 (1993).iso
/
new
/
arq002.arj
/
ARQ.BTM
next >
Wrap
Text File
|
1993-07-14
|
9KB
|
301 lines
@echo off
setlocal
echo ARQ v0.02 - multiple archiver command-line shell
echo Copyright 1993 by Roger Burton-West [ubte30e@ccs.bbk.ac.uk]
echo;
if "%2" == "" goto parms
set cmd=%@lower[%1]
set archive=%@full[%2]
set files=%3
set type=%@upper[%@ext[%2]]
if "%files" == "" set files=*.*
if "%type" == "" set type=ARJ
for %a in (a m x d l v t c s s1) if %a == %cmd goto goodcmd
goto badcmd
:goodcmd
for %a in (ARJ ZIP ARC LZH PAK ZOO HYP DWC LZS HPK HA AR MD SQZ LBR HAP) if %a == %type goto goodarc
goto badarc
:goodarc
iff "%type" == "ARJ" then
if %cmd == a ARJ a -a+ -e1 -m1+ -r+ -y+ -jt+ -jg+ -jm %archive %files
if %cmd == m ARJ m -a+ -e1 -m1+ -r+ -y+ -jt+ -jg+ -jm %archive %files
if %cmd == x ARJ x -y+ -jg+ %archive %files
if %cmd == d ARJ d -y+ %archive %files
if %cmd == l ARJ l %archive %files
if %cmd == v ARJ v -jv1 %archive %files
if %cmd == t arj t %archive %files
if %cmd == c arj c -z%files %archive
if %cmd == s arj y -je %archive
if %cmd == s1 arj y -je1 %archive
goto endok
endiff
iff "%type" == "ZIP" then
if %cmd == a PKZIP -a -r -p -q -ex -wHS %archive %files
if %cmd == m PKZIP -m -a -r -p -q -ex -wHS %archive %files
if %cmd == x PKUNZIP -d %archive %files
if %cmd == d PKZIP -d %archive %files
if %cmd == l pkunzip -vb %archive %files
if %cmd == v pkunzip -vm %archive %files
if %cmd == t pkunzip -t %archive %files
if %cmd == c pkzip %archive -z -q <%files
if %cmd == s zip2exe %archive
if %cmd == s1 zip2exe -j %archive
goto endok
endiff
iff "%type" == "ARC" then
if %cmd == a ARC a %archive %files
if %cmd == m ARC m %archive %files
if %cmd == x ARC x %archive %files
if %cmd == d ARC d %archive %files
if %cmd == l ARC l %archive %files
if %cmd == v ARC v %archive %files
if %cmd == t ARC t %archive %files
if %cmd == c goto nocomm
if %cmd == s mksarc %@name[%archive]
if %cmd == s1 mksarc %@name[%archive]
goto endok
endiff
iff "%type" == "LZH" then
if %cmd == a LHA a /a+ /r+ /x+ %archive %files
if %cmd == m LHA m /a+ /r+ /x+ %archive %files
if %cmd == x LHA x /a+ %archive %files
if %cmd == d LHA d /a+ %archive %files
if %cmd == l LHA l /a+ %archive %files
if %cmd == v LHA v /a+ %archive %files
if %cmd == t LHA t /a+ %archive %files
if %cmd == c goto nocomm
if %cmd == s LHA s -x1 %archive
if %cmd == s1 LHA s -x0 %archive
goto endok
endiff
iff "%type" == "PAK" then
if %cmd == a PAK a /I %archive %files
if %cmd == m PAK m /I %archive %files
if %cmd == x PAK e /path %archive %files
if %cmd == d PAK d /path %archive %files
if %cmd == l pak l %archive %files
if %cmd == v pak v /path %archive %files
if %cmd == t pak t %archive %files
if %cmd == c goto nocomm
if %cmd == s PAK c /exe %archive
if %cmd == s1 PAK c /exe %archive
goto endok
endiff
iff "%type" == "ZOO" then
if %cmd == a STUFF %files | ZOO aIh %archive
if %cmd == m (STUFF %files | ZOO aIh %archive ^ gosub dodel)
if %cmd == x ZOO x.// %archive %files
if %cmd == d ZOO DP %archive %files
if %cmd == l zoo l %archive %files
if %cmd == v zoo lVC %archive %files
if %cmd == t zoo xND %archive %files
if %cmd == c goto nocomm
if %cmd == s sez %@name[%archive] %@name[%archive]
if %cmd == s1 sez %@name[%archive] %@name[%archive]
goto endok
endiff
iff "%type" == "HYP" then
if %cmd == a HYPER -a -r -p %archive %files
if %cmd == m HYPER -m -r -p %archive %files
if %cmd == x HYPER -x -p %archive %files
if %cmd == d HYPER -d %archive %files
if %cmd == l hyper -v %archive %files
if %cmd == v hyper -v %archive %files
if %cmd == t goto notest
if %cmd == c goto nocomm
if %cmd == s Copy /b Hyper.EXE+%archive %@name[%archive].EXE
if %cmd == s1 Copy /b Hyper.EXE+%archive %@name[%archive].EXE
goto endok
endiff
iff "%type" == "DWC" then
if %cmd == a DWC a %archive %files
if %cmd == m DWC m %archive %files
if %cmd == x DWC e %archive %files
if %cmd == d DWC d %archive %files
if %cmd == l dwc l %archive %files
if %cmd == v dwc v %archive %files
if %cmd == t dwc t %archive %files
if %cmd == c goto nocomm
if %cmd == s goto nosfx
if %cmd == s1 goto nosfx
goto endok
endiff
iff "%type" == "LZS" then
if %cmd == a LARC a /r %archive %files
if %cmd == m (LARC a /r %archive %files ^ gosub dodel)
if %cmd == x LARC e /x %archive %files
if %cmd == d LARC d %archive %files
if %cmd == l larc l %archive %files
if %cmd == v larc l %archive %files
if %cmd == t goto notest
if %cmd == c goto nocomm
if %cmd == s larc s %archive
if %cmd == s1 larc s %archive
goto endok
endiff
iff "%type" == "HPK" then
if %cmd == a HPACK a -r -da -a %archive %files
if %cmd == m HPACK a -f -r -da -a %archive %files
if %cmd == x HPACK x -da -r %archive %files
if %cmd == d HPACK D %archive %files
if %cmd == l hpack v -vf %archive %files
if %cmd == v hpack v %archive %files
if %cmd == t hpack t %archive %files
if %cmd == c hpack a -wa %archive %files
if %cmd == s goto nosfx
if %cmd == s1 goto nosfx
goto endok
endiff
iff "%type" == "HA" then
if %cmd == a HA a21ra %archive %files
if %cmd == m HA a21ram %archive %files
if %cmd == x HA xya %archive %files
if %cmd == d HA d %archive %files
if %cmd == l ha l %archive %files
if %cmd == v ha lf %archive %files
if %cmd == t ha t %archive %files
if %cmd == c goto nocomm
if %cmd == s goto nosfx
if %cmd == s1 goto nosfx
goto endok
endiff
iff "%type" == "AR" then
if %cmd == a for %%qux in (%files) ar a %archive %%qux
if %cmd == m (for %%qux in (%files) ar a %archive %%qux^gosub dodel)
if %cmd == x ar x %archive %files
if %cmd == d ar d %archive %files
if %cmd == l ar l %archive %files
if %cmd == v ar l %archive %files
if %cmd == t goto notest
if %cmd == c goto nocomm
if %cmd == s goto nosfx
if %cmd == s1 goto nosfx
goto endok
endiff
iff "%type" == "MD" then
if %cmd == a mdcd c %files %archive
if %cmd == m (mdcd c %files %archive^gosub dodel)
if %cmd == x mdcd d %archive
if %cmd == d goto nodel
if %cmd == l mdcd l %archive %files
if %cmd == v mdcd f %archive %files
if %cmd == t goto notest
if %cmd == c goto nocomm
if %cmd == s goto nosfx
if %cmd == s1 goto nosfx
goto endok
endiff
iff "%type" == "SQZ" then
if %cmd == a sqz a %archive /WSp0q0a?=z1 %files
if %cmd == m sqz am %archive /WSp0q0a?=z1 %files
if %cmd == x sqz x %archive /z1 %files
if %cmd == d sqz d %archive %files
if %cmd == l sqz l %archive %files
if %cmd == v sqz v %archive %files
if %cmd == t sqz t %archive %files
if %cmd == c sqz c %archive %files
if %cmd == s sqz s %archive
if %cmd == s1 sqz s /z2 %archive
goto endok
endiff
iff "%type" == "LBR" then
if %cmd == a luu %archive %files /n
if %cmd == m (luu %archive %files /n^gosub dodel)
if %cmd == x lue %archive %files
if %cmd == d lud %archive %files
if %cmd == l lut %archive %files
if %cmd == v lut %archive %files
if %cmd == t goto notest
if %cmd == c goto nocomm
if %cmd == s goto nosfx
if %cmd == s1 goto nosfx
goto endok
endiff
iff "%type" == "HAP" then
if %cmd == a hap a %archive %files
if %cmd == m (hap a %archive %files^gosub dodel)
if %cmd == x pah e %archive %files
if %cmd == d pah d %archive %files
if %cmd == l hap l %archive %files
if %cmd == v hap l %archive %files
if %cmd == t goto notest
if %cmd == c goto nocomm
if %cmd == s goto nosfx
if %cmd == s1 goto nosfx
goto endok
endiff
:parms
echo Too few parameters.
goto syntax
:badcmd
echo Invalid command: only a, m, x, d, l, v, t, c, s, s1
goto syntax
:syntax
echo syntax: ARQ command archive [filespec]
echo where command is one of:
echo a : add files to archive (recurse subdirs if available)
echo m : move files to archive (add only if move not available)
echo x : extract files from archive
echo d : delete files from archive
echo l : brief listing of archive
echo v : verbose listing of archive
echo t : test archive
echo c : add comment file to archive
echo s : make self-extractor (s1 for small SFX)
goto end
:badarc
echo %type files are an invalid archive type (not supported).
goto end
:notest
echo Sorry, cannot test archives of type %type. Try extracting instead.
goto end
:nodel
echo Sorry, cannot delete files in type %type archive. Try rebuilding instead.
goto end
:nocomm
echo Sorry, archive comments are not available for type %type archives.
goto end
:nosfx
echo Sorry, self-extraction is not available for type %type archives.
goto end
:dodel
if %? NE 0 return
if exist %files del /sy %files >nul
return
:endok
iff %? == 0 then
echo Command completed.
else
echo Problem with command: error code %?.
endiff
:end
endlocal